پرش به مطلب اصلی

Reseller Renew User Subscription with New Group API

POST /resellerRenewUserSubscriptionWithNewGroup

Description

This API endpoint allows resellers to renew a user's subscription and change the group they are associated with. This will update the user's subscription details and group membership.

Request Body

The request utilizes GraphQL to perform the resellerRenewUserSubscriptionWithNewGroup mutation.

Mutation:

mutation resellerRenewUserSubscriptionWithNewGroup ($username: String!, $groupId: Int!) {
resellerRenewUserSubscriptionWithNewGroup (username: $username, groupId: $groupId) {
duration
multiLoginCount
expiresAt
createdAt
updatedAt
dailyBandwidth
downloadUpload
}
}

Variables:

{
"username": "<User_Username>",
"groupId": <New_Group_Id>
}
  • username (String): The username of the user whose subscription is to be renewed.
  • groupId (Int): The ID of the new group to which the user will be assigned.

Response:

  • Success (200 OK):

    • If the renewal is successful and the user is reassigned to the new group, the response will include the updated subscription details.
    {
    "data": {
    "resellerRenewUserSubscriptionWithNewGroup": {
    "duration": "<New_Duration>",
    "multiLoginCount": "<Updated_Login_Count>",
    "expiresAt": "<New_Expiry_Date>",
    "createdAt": "<Creation_Date>",
    "updatedAt": "<Update_Date>",
    "dailyBandwidth": "<Updated_Bandwidth>",
    "downloadUpload": "<Updated_Download_Upload_Details>"
    }
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with the renewal or group reassignment process, the response will include an appropriate error message and status code.

Note:

Ensure that both the username and group ID are valid. This API will renew the user's subscription for the specified new group and update the relevant subscription attributes.